<!--  -->
<template>
  <el-container>
    <el-main>
      <div class="hotAblum">
        <ul>
          <li v-for="(item, index) in hotAlbums" :key="index">
            <div class="img">
              <img @click="ToDetail(item.id)" :src="item.picUrl" alt="" />
            </div>
            <div class="title">{{ item.name }}</div>
            <span class="time">{{ item.publishTime | dateFormat }}</span>
          </li>
        </ul>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import { getSingerAblum } from "util/findMusic.js";
export default {
  name: "",
  data() {
    return {
      currentId: this.$route.params.id,
      hotAlbums: [],
    };
  },
  created() {
    this.getSingerAblum();
  },
  methods: {
    async getSingerAblum() {
      let {
        data: { hotAlbums },
      } = await getSingerAblum(this.currentId);
      this.hotAlbums = hotAlbums;
      // console.log(hotAlbums);
    },
    ToDetail(id) {
      this.$router.push("/albumDetail/" + id);
    },
  },
};
</script>

<style scoped>
.hotAblum ul {
  display: flex;
  flex-wrap: wrap;
}
.hotAblum ul li {
  padding: 0 1px 0 10px;
  margin-right: 45px;
  /* margin-right: 40px; */
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.hotAblum ul li .img {
  width: 150px;
  height: 150px;
  margin-bottom: 10px;
}
.hotAblum ul li .img img {
  border-radius: 5px;
  width: 100%;
  height: 100%;
}
.hotAblum ul li .title {
  width: 150px;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.hotAblum ul li span {
  font-size: 12px;
  color: rgb(141, 135, 135);
}
</style>